import ThirdLayout from "~/layout/ThirdLayout";
import ManagementBasisRouter, {LAWS_REGULATIONS} from "./ManagementBasisRouter";
import OnlineEducationRouter, {ADAPTATION_PLAN} from "./OnlineEducationRouter";
import SafetyInspectorRouter, {SHIFT_TURNOVER} from "./SafetyInspectorRouter";
import HiddenDangerInvestigationRouter, {HIDDEN_TROUBLE_NVESTIGATION_AND_MANAGEMENT} from "./HiddenDangerInvestigationRouter";
import AccidentReportRouter, {ACCIDENT_REPORT_BODY} from "./AccidentReportRouter";
import EmergencyManagementRouter, {EMERGENCY_PLAN} from "./EmergencyManagementRouter";
import SparePartsManagementRouter, {SPARE_PARTS} from "./SparePartsManagementRouter"

export const MANAGEMENT_BASIS ="management-basis";
export const OPERATING_PROCEDURES ="operating-procedures";
export const ONLINE_EDUCATION ="online-education";
export const SAFETY_INSPECTOR ="safety-inspector";
export const HIDDEN_DANGER_INVESTIGATION ="hidden-danger-investigation";
export const ACCIDENT_REPORT ="accident-report";
export const EMERGENCY_MANAGEMENT ="emergency-management";
export const SPARE_PARTS_MANAGEMENT ="spare-parts-management";


export const OPERATING_PROCEDURES_BODY ="operating-procedures-body";

const routers = [
    {
        name: MANAGEMENT_BASIS,
        path: MANAGEMENT_BASIS,
        component: ThirdLayout,
        children: ManagementBasisRouter,
        redirect: { name: LAWS_REGULATIONS },
        meta: {
            icon: "icon-blocks",
            label: "管理依据",
            hasThird: true,
        },
    },
    {
        name: OPERATING_PROCEDURES,
        path: OPERATING_PROCEDURES,
        component: ThirdLayout,
        redirect: { name: OPERATING_PROCEDURES_BODY },
        children: [
            {
                name: OPERATING_PROCEDURES_BODY,
                path: "body",
                component: ()=>import("~/views/safety-management/OperatingProcedures"),
                meta: {
                    label: "操作规程"
                },
            }
        ],
        meta: {
            icon: "el-icon-document",
            label: "操作规程",
        }
    },
    {
        name: ONLINE_EDUCATION,
        path: ONLINE_EDUCATION,
        component: ThirdLayout,
        children: OnlineEducationRouter,
        redirect: { name: ADAPTATION_PLAN },
        meta: {
            icon: "icon-note",
            label: "安全教育",
            hasThird: true,
        }
    },
    {
        name: SAFETY_INSPECTOR,
        path: SAFETY_INSPECTOR,
        component: ThirdLayout,
        children: SafetyInspectorRouter,
        redirect: { name: SHIFT_TURNOVER },
        meta: {
            icon: "icon-node-book",
            label: "安全巡查",
            hasThird: true,
        },
    },
    {
        name: HIDDEN_DANGER_INVESTIGATION,
        path: HIDDEN_DANGER_INVESTIGATION,
        component: ThirdLayout,
        children: HiddenDangerInvestigationRouter,
        redirect: { name: HIDDEN_TROUBLE_NVESTIGATION_AND_MANAGEMENT },
        meta: {
            icon: "icon-error",
            label: "双重预防体系",
            hasThird: true,
        },
    },
    {
        name: ACCIDENT_REPORT,
        path: ACCIDENT_REPORT,
        component: ThirdLayout,
        children: AccidentReportRouter,
        redirect: { name: ACCIDENT_REPORT_BODY },
        meta: {
            icon: "el-icon-upload2",
            label: "事故上报",
            hasThird: true,
        },
    },
    {
        name: EMERGENCY_MANAGEMENT,
        path: EMERGENCY_MANAGEMENT,
        component: ThirdLayout,
        children: EmergencyManagementRouter,
        redirect: { name: EMERGENCY_PLAN },
        meta: {
            icon: "el-icon-warning-outline",
            label: "应急管理",
            hasThird: true,
        },
    },
    {
        name: SPARE_PARTS_MANAGEMENT,
        path: SPARE_PARTS_MANAGEMENT,
        component: ThirdLayout,
        children: SparePartsManagementRouter,
        redirect: { name: SPARE_PARTS },
        meta: {
            icon: "el-icon-s-operation",
            label: "备品备件管理",
            hasThird: true,
        },
    },
];

export default routers;
